As a conventional image encoding method, a method of calculating a predicted pixel, quantizing the predicted pixel obtained by the calculation, and encoding quantized data obtained by the quantization is known. As the calculation method for the predicted pixel, a method of using a plurality of reference pixels which are close in the horizontal direction every color component with respect to RGB data arranged according to the Bayer pattern in the SMIA (Standard Mobile Imaging Architecture) is known. In the Bayer pattern, color components a rearranged at intervals of one pixel in the horizontal direction. In other words, a predicted pixel is calculated by using an original pixel which becomes an object of prediction and a reference pixel located at a distance corresponding to two pixels in the horizontal direction from the original pixel.
However, a difference value between the original pixel and the predicted pixel becomes large according to a distance between the reference pixel and the prediction object pixel. Furthermore, as the difference value becomes large, the quantization error also becomes large. In other words, the quantization error in the conventional encoding method is equivalent to a distance corresponding to two pixels.
In general, as the quantization error becomes large, the signal to noise ratio (hereafter referred to as SN ratio) in the encoding falls. Falling of the SN ratio exerts a bad influence upon the picture quality obtained when reproducing decoded data (that is, image data) obtained by decoding coded data.
Furthermore, in the Bayer pattern, although there is no sensitivity difference between pixels in the horizontal direction, there is a sensitivity difference between pixels in the vertical direction. Even if the interval in the vertical direction is one pixel or less, therefore, calculation of the predicted pixel based upon the original pixel located in the closest position in the vertical direction brings about lowering of the SN ratio at the time of encoding processing.